home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mgr_2 / src / atari / test_rop.c < prev   
C/C++ Source or Header  |  1990-08-10  |  1KB  |  67 lines

  1. /* test small bitblit functions */
  2.  
  3. #include <stdio.h>
  4. #include "bitmap.h"
  5.  
  6. extern int bit_debug;
  7.  
  8. #define message(x) \
  9.     if(bit_debug){printf("%s\n",x);fflush(stdout);}
  10.  
  11. #define SIZE        32                /* basic size */
  12.  
  13. int bit_debug = 0;
  14.  
  15. main(argc,argv)
  16. char **argv;
  17.    {
  18.    register BITMAP *screen;
  19.    BITMAP *src,*dst;
  20.    int wait=1;
  21.     int size;
  22.     int x0;
  23.    register int i,j,x;
  24.  
  25.    if (argc>1) 
  26.         size = atoi(argv[1]);
  27.     else
  28.         size=SIZE;
  29.    bit_debug = getenv("DEBUG");
  30.  
  31.    screen = bit_open("/dev/bwtwo0");
  32.  
  33.    /* make src and dst */
  34.  
  35.    src = bit_alloc(size,size,0);
  36.    dst = bit_alloc(size,size,0);
  37.    
  38.    message("Make src and dst");
  39.  
  40.    mem_rop(src,0,0,size/2,size,BIT_CLR,0,0,0);
  41.    mem_rop(src,size/2,0,size/2,size,BIT_SET,0,0,0);
  42.  
  43.    mem_rop(dst,0,0,size,size/2,BIT_CLR,0,0,0);
  44.    mem_rop(dst,0,size/2,size,size/2,BIT_SET,0,0,0);
  45.  
  46.    /* test 16 bitmem_rop functions */
  47.  
  48.    message("16 borders");
  49.    for(i=0;i<16;i++) {
  50.         x0 = i*(size+10);
  51.       mem_rop(screen,10+x0%900,100+(size+10)*(x0/900),size,size,BIT_SET,0,0,0);
  52.         if (wait) sleep(1);
  53.         }
  54.    message("16 dst patterns");
  55.    for(i=0;i<16;i++) {
  56.         x0 = i*(size+10);
  57.       mem_rop(screen,12+x0%900,102+(size+10)*(x0/900),size-4,size-4,BIT_SRC,dst,2,2);
  58.         if (wait) sleep(1);
  59.         }
  60.    message("16 bit-blt functions");
  61.    for(i=0;i<16;i++) {
  62.         x0 = i*(size+10);
  63.       mem_rop(screen,12+x0%900,102+(size+10)*(x0/900),size-4,size-4,i,src,2,2);
  64.       if (wait) sleep(1);
  65.       }
  66.    }
  67.